import request from '@/utils/request'

const prevUrl = '/consume/warehouse/';

export default {

  // 查询列表
  list(query, pageReq) {
    return request({
      url: `${prevUrl}list`,
      method: 'post',
      data: query,
      params: pageReq
    })
  },
  // 查询明细
  getDetail(id) {
    return request({
      url: `${prevUrl}${id}`,
      method: 'get'
    })
  },
  // 新增
  add(data) {
    return request({
      url: `${prevUrl}`,
      method: 'post',
      data: data
    })
  },
  // 修改
  update(data) {
    return request({
      url: `${prevUrl}`,
      method: 'put',
      data: data
    })
  },
  // 删除
  del(id) {
    return request({
      url: `${prevUrl}${id}`,
      method: 'delete'
    })
  },
  // 导出
  export(query) {
    return request({
      url: `${prevUrl}export`,
      method: 'get',
      params: query
    })
  }
}

